arr = [45,3,4,8,9,2,234,23,23,1,45,889];

var  res = quickSort(arr);

console.log(res);

function quickSort(array){

	var left=0,right=array.length-1;

	quick_Sort(left,right,array);
	

	return array;
}

function quick_Sort(left,right,array){

	if (left>=right) {return array;};

	var i=left,j=right,t,temp=array[left];
	while(i!=j){
		while(array[j]>=temp&&i!=j){
			j--;
		}
		while(array[i]<=temp&&i!=j){
			i++;
		}
		if (i<j) {
			t=arr[i];
			array[i]=arr[j];
			array[j]=t;
		};
	}
	array[left]=array[i];
	array[i]=temp;
	quick_Sort(left,i-1,array);
	quick_Sort(i+1,right,array);
	return array;
} 